package com.googlecode.lohr.parser.combinators.matcher;



public class NamedMatcher extends Matcher
{
	public final String id;
	private Matcher definition;

	public NamedMatcher(String id)
	{
		this.id = id;
	}

	public NamedMatcher define(Matcher definition)
	{
		this.definition = definition;
		return this;
	}

	public Matcher getDefinition() {
		return definition;
	}

	@Override
	public void match(MatchContext ctx, int start) 
	{
		new WrappedMatchTask(ctx, this, definition, start);
	}
}
